/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.seaworldsoft.xinxifabu.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 *
 * @author sam
 */
@Entity
@Table(name="sys_user")
public class User {
     @Id
	@TableGenerator(name = "user", table = "sys_generator", pkColumnName = "key_name", pkColumnValue = "User_ID", valueColumnName = "key_value", initialValue = 1, allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "user")
     private int userId;
     
     @Column(length=50)
     private String userName;
     
     @ManyToOne
     @JoinColumn(name="role_id")
     private Role role;

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }
     
     
     
     
     
}
